2 # Copyright (C) 2004 Magnus Manske <magnus.manske@web.de>
3 # http://www.mediawiki.org/
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # http://www.gnu.org/copyleft/gpl.html
23 * @subpackage SpecialPage
29 * @subpackage SpecialPage
37 # Reads all revision information of the specified article
38 function prepareRevisions( $id ) {
40 $this->rev2date
= array();
41 $this->date2rev
= array();
42 $sql = "SELECT * FROM {$wgDBprefix}revision WHERE rev_page='{$id}'";
43 $res = wfQuery( $sql, DB_READ
);
44 while( $x = wfFetchObject( $res ) ) {
45 $this->rev2date
[$x->rev_id
] = $x;
46 $this->date2rev
[$x->rev_timestamp
] = $x;
50 # Returns a HTML link to the specified article revision
51 function getVersionLink( &$article, $revision, $text = "" ) {
52 $t = $article->getTitle();
53 if( $text == "" ) $text = wfMsg("val_view_version");
54 $ret = "<a href=\"" . htmlspecialchars($t->getLocalURL( "oldid={$revision}" )) . "\">" . $text . "</a>";
58 # Returns an array containing all topics you can vote on
59 function getTopicList() {
62 $sql = "SELECT * FROM {$wgDBprefix}validate WHERE val_page=0";
63 $res = wfQuery( $sql, DB_READ
);
64 while( $x = wfFetchObject( $res ) ) {
65 $ret[$x->val_type
] = $x;
71 # Merges one dataset into another
72 function mergeInto( &$source, &$dest ) {
74 foreach( $source as $x => $y ) {
76 if( !isset( $dest[$x] ) ) {
78 } elseif( $dest[$x]->value
== 0 ) {
92 # Merges all votes prior to the given revision into it
93 function mergeOldRevisions( &$article, $revision ) {
94 $tmp = $this->voteCache
;
97 $ts = $this->getTimestamp( $revision );
98 $data = $this->voteCache
[$ts];
99 foreach( $tmp as $x => $y ) {
101 if( $this->mergeInto( $y, $data ) ) {
107 $this->setRevision( $article, $revision, $data );
111 # Clears all votes prior to the given revision
112 function clearOldRevisions( &$article, $revision ) {
113 $tmp = $this->voteCache
;
114 $ts = $this->getTimestamp( $revision );
115 foreach( $tmp as $x => $y ) {
117 $this->deleteRevision ( $article, $this->getRevisionNumber( $x ) );
122 # Updates the votes for the given revision from the FORM data
123 function updateRevision( &$article, $revision ) {
124 global $wgUser, $wgRequest;
126 if( isset( $this->voteCache
[$this->getTimestamp( $revision )] ) ) {
127 $data = $this->voteCache
[$this->getTimestamp( $revision )];
131 $nv = $wgRequest->getArray( "re_v_{$revision}", array() );
132 $nc = $wgRequest->getArray( "re_c_{$revision}", array() );
134 foreach( $nv as $x => $y ) {
135 $data[$x]->value
= $y;
136 $data[$x]->comment
= $nc[$x];
140 $this->setRevision( $article, $revision, $data );
143 # Sets a specific revision to both cache and database
144 function setRevision( &$article, $revision, &$data ) {
146 $this->deleteRevision( $article, $revision );
147 $this->voteCache
[$this->getTimestamp( $revision )] = $data;
148 foreach( $data as $x => $y ) {
149 if( $y->value
> 0 ) {
150 $ip = $wgUser->isAnon() ?
$wgUser->getName() : '';
151 $dbw =& wfGetDB( DB_MASTER
);
152 $dbw->insert( 'validate',
154 'val_user' => $wgUser->getId(),
155 'val_page' => $article->getId(),
156 'val_revision' => $revision,
158 'val_value' => $y->value
,
159 'val_comment' => $y->comment
,
161 'Validation::setRevision' );
166 # This function returns a MySQL statement to identify the current user
167 function identifyMe( $user = "" ) {
169 if( $user == "" ) $user = $wgUser->GetID();
170 if( User
::isIP( $user ) ) {
171 return "(val_user='0' AND val_ip='{$user}')";
173 return "(val_user='{$user}')";
177 # Deletes a specific vote set in both cache and database
178 function deleteRevision( &$article, $revision ) {
179 global $wgUser, $wgDBprefix;
180 $ts = $this->getTimestamp( $revision );
181 if( !isset ( $this->voteCache
[$ts] ) ) {
182 return; # Nothing to do
184 $sql = "DELETE FROM {$wgDBprefix}validate WHERE" . $this->identifyMe() . " AND ";
185 $sql .= " val_page='" . $article->getID() . "' AND val_revision='{$revision}'";
186 $res = wfQuery( $sql, DB_WRITE
);
187 unset( $this->voteCache
[$ts] );
190 # Reads the entire vote list for this user for the given article
191 function getVoteList( $id, $user = "" ) {
192 global $wgUser, $wgDBprefix;
194 $user = $wgUser->GetID();
196 $r = array() ; # Revisions
197 $sql = "SELECT * FROM {$wgDBprefix}validate WHERE val_page=" . $id . " AND " . $this->identifyMe( $user );
198 $res = wfQuery( $sql, DB_READ
);
199 while( $x = wfFetchObject( $res ) ) {
200 #$y = $x->val_revision;
201 $y = $this->rev2date
[$x->val_revision
];
202 $y = $y->rev_timestamp
;
203 if( !isset( $r[$y] ) ) {
206 $r[$y][$x->val_type
]->value
= $x->val_value
;
207 $r[$y][$x->val_type
]->comment
= $x->val_comment
;
212 # Reads the entire vote list for this user for all articles
213 function getAllVoteLists( $user ) {
215 $r = array() ; # Revisions
216 $sql = "SELECT * FROM {$wgDBprefix}validate WHERE " . $this->identifyMe( $user );
217 $res = wfQuery( $sql, DB_READ
);
218 while( $x = wfFetchObject( $res ) ) {
220 $y = $x->val_revision
;
221 if( !isset( $r[$a] ) ) {
224 if( !isset( $r[$a][$y] ) ) {
225 $r[$a][$y] = array();
227 $r[$a][$y][$x->val_type
] = $x;
232 # This functions adds a topic to the database
233 function addTopic( $topic, $limit ) {
236 while( isset( $this->topicList
[$a] ) ) {
239 $sql = "INSERT INTO {$wgDBprefix}validate (val_user,val_page,val_revision,val_type,val_value,val_comment,val_ip) VALUES (";
240 $sql .= "'0','0','0','{$a}','{$limit}','";
241 $sql .= Database
::strencode( $topic ) . "','')";
242 $res = wfQuery( $sql, DB_WRITE
);
243 $x->val_user
= $x->val_page
= $x->val_revision
= 0;
245 $x->val_value
= $limit;
246 $x->val_comment
= $topic;
248 $this->topicList
[$a] = $x;
249 ksort( $this->topicList
);
252 # This functions adds a topic to the database
253 function deleteTopic( $id ) {
255 $dbw =& wfGetDB( DB_MASTER
);
256 $dbw->delete( 'validate',
257 array( 'val_type' => $id ),
258 'Validation::deleteTopic' );
259 unset( $this->topicList
[$id] );
262 # This function returns a link text to the page validation statistics
263 function link2statistics( &$article ) {
264 $nt = $article->getTitle();
265 $url = $nt->escapeLocalURL( "action=validate&mode=list" );
266 return wfMsg( 'val_rev_stats_link', $nt->getPrefixedText(), $url );
269 # This function returns a link text to the page validation statistics of a single revision
270 function link2revisionstatistics( &$article, $revision ) {
271 $nt = $article->getTitle();
272 $url = $nt->escapeLocalURL( "action=validate&mode=details&revision={$revision}" );
273 return wfMsg( 'val_revision_stats_link', $url );
276 # This function returns a link text to the user rating statistics page
277 function link2userratings( $user, $text ) {
280 $user = $wgUser->GetName();
282 $nt = Title
::newFromText( "Special:Validate" );
283 $url = htmlspecialchars( $nt->getLocalURL( "mode=userstats&user={$user}" ) );
284 return "<a href=\"{$url}\">{$text}</a>";
287 # Returns the timestamp of a revision based on the revision number
288 function getTimestamp( $revision ) {
289 $ts = $this->rev2date
[$revision];
290 $ts = $ts->rev_timestamp
;
294 # Returns the revision number of a revision based on the timestamp
295 function getRevisionNumber( $ts ) {
296 $revision = $this->date2rev
[$ts];
297 $revision = $revision->rev_id
;
302 # HTML generation functions from this point on
304 # Returns the metadata string for a revision
305 function getMetadata( $idx ) {
307 $x = $this->rev2date
[$idx];
308 $metadata .= wfTimestamp( TS_DB
, $x->rev_timestamp
);
310 if( $x->rev_user
== 0 ) {
311 $metadata .= $x->rev_user_text
;
314 $u->setId( $x->rev_user
);
315 $u->setName( $x->rev_user_text
);
316 $nt = $u->getUserPage();
317 $url = "<a href='" . $nt->getLocalUrl() . "'>" . $nt->getText() . "</a>";
320 $metadata .= " : <small>\"" . htmlspecialchars( $x->rev_comment
) . "\"</small>";
324 # Generates a link to the topic description
325 function linkTopic ( $s ) {
326 $t = Title
::newFromText ( wfMsg ( 'val_topic_desc_page' ) ) ;
328 $r .= $t->getLocalURL () ;
329 $r .= "#" . urlencode ( $s ) ;
330 $r .= "\">{$s}</a>" ;
334 # Generates a form for a single revision
335 function getRevisionForm( &$article, $idx, &$data, $focus = false ) {
336 # Fill data with blank values
338 $revision = $this->getRevisionNumber( $ts );
339 foreach( $this->topicList
as $x => $y ) {
340 if( !isset( $data[$x] ) ) {
341 $data[$x]->value
= 0;
342 $data[$x]->comment
= "";
348 $ret = "<form method='post'>";
349 $ret .= "<table border='1' cellspacing='0' cellpadding='2'";
351 $ret .= " style='background-color:#00BBFF'";
354 $head = "Revision #" . $revision;
355 $link = " " . $this->getVersionLink( $article, $revision );
356 $metadata = $this->getMetadata( $revision );
357 $ret .= "<tr><th align='left' colspan='3'>" . $head . " ({$link}) {$metadata}</th></tr>\n";
359 foreach( $data as $x => $y ) {
361 $col = $line == 1 ?
"#DDDDDD" : "#EEEEEE";
362 $idx = "_{$revision}[{$x}]";
363 $ret .= "<tr bgcolor='{$col}'>\n";
364 $ret .= "<th nowrap>";
365 $ret .= $this->linkTopic ( $this->topicList
[$x]->val_comment
) ;
368 $tlx = $this->topicList
[$x];
370 $max = $tlx->val_value
;
371 for( $a = 0 ; $a <= $max ; $a++
) {
373 $vote .= wfMsg ( "val_noop" );
375 $vote .= "<input type='radio' name='re_v{$idx}' value='{$a}'";
376 if( $a == $y->value
) {
380 if( $max == 2 && $a == 1 ) {
381 $vote .= wfMsg( "val_no" ) . " ";
382 } elseif( $max == 2 && $a == 2 ) {
383 $vote .= wfMsg( "val_yes" );
384 } elseif( $a != 0 ) {
391 $ret .= "<td nowrap valign='center'>{$vote}</td>\n";
393 $ret .= "<td width='100%' align='center'><input size='50' style='width:98%' maxlength='250' type='text' name='re_c{$idx}' value='{$y->comment}'/>";
394 $ret .= "</td></tr>\n";
396 $checked = $focus ?
" checked='checked'" : "";
397 $ret .= "<tr><td colspan='3' valign='center'>\n";
398 $ret .= "<input type='checkbox' name='re_merge_{$revision}' value='1'{$checked}/>" . htmlspecialchars( wfMsg( 'val_merge_old' ) ) . " \n";
399 $ret .= "<input type='checkbox' name='re_clear_{$revision}' value='1'{$checked}/>" . htmlspecialchars( wfMsg( 'val_clear_old' ) ) . " \n";
400 $ret .= "<input type='submit' name='re_submit[{$revision}]' value='" . htmlspecialchars( wfMsg("ok") ) . "'/>\n";
402 $ret .= "<br/>\n<small>" . htmlspecialchars( wfMsg( "val_form_note" ) ) . "</small>";
404 $ret .= "</td></tr>\n";
405 $ret .= "</table>\n</form>\n\n";
410 # Generates the page from the validation tab
411 function validatePageForm( &$article, $revision ) {
412 global $wgOut, $wgRequest, $wgUser;
415 $this->prepareRevisions( $article->getID() );
416 $this->topicList
= $this->getTopicList();
417 $this->voteCache
= $this->getVoteList( $article->getID() );
419 # Check for POST data
420 $re = $wgRequest->getArray( 're_submit' );
421 if ( isset( $re ) ) {
422 $id = array_keys( $re );
423 $id = $id[0] ; # $id is now the revision number the user clicked "OK" for
424 $clearOldRev = $wgRequest->getVal( "re_clear_{$id}", 0 );
425 $mergeOldRev = $wgRequest->getVal( "re_merge_{$id}", 0 );
426 $this->updateRevision( $article, $id );
428 $this->mergeOldRevisions( $article, $id );
431 $this->clearOldRevisions( $article, $id );
433 $ret .= "<p><font color='red'>" . htmlspecialchars( wfMsg( 'val_revision_changes_ok' ) ) . "</font></p>";
435 else $ret .= wfMsg ( 'val_votepage_intro' ) ;
437 # Make sure the requested revision exists
438 $ts = $this->rev2date
[$revision]->rev_timestamp
;
439 if( !isset( $this->voteCache
[$ts] ) ) {
440 $this->voteCache
[$ts] = array();
443 # Sort revisions list, newest first
444 krsort( $this->voteCache
);
447 $title = $article->getTitle();
448 $title = $title->getPrefixedText();
449 $wgOut->setPageTitle( wfMsg( 'val_rev_for' ) . $title );
450 foreach( $this->voteCache
as $x => $y ) {
451 $ret .= $this->getRevisionForm( $article, $x, $y, $x == $ts );
454 $ret .= $this->link2statistics( $article );
455 $ret .= "<p>" . $this->link2userratings( $wgUser->getID(), wfMsg( 'val_show_my_ratings' ) ) . "</p>";
459 # This function performs the "management" mode on Special:Validate
460 function manageTopics() {
462 $this->topicList
= $this->getTopicList();
464 $iamsure = $wgRequest->getVal( "iamsure", "0" ) == 1;
466 if( $iamsure && $wgRequest->getVal( "m_add", "--" ) != "--" ) {
467 $new_topic = $wgRequest->getVal( "m_topic" );
468 $new_limit = $wgRequest->getVal( "m_limit" );
469 if( $new_topic != "" && $new_limit > 1 ) {
470 $this->addTopic( $new_topic, $new_limit );
474 $da = $wgRequest->getArray( "m_del" );
475 if( $iamsure && isset( $da ) && count( $da ) > 0 ) {
476 $id = array_keys( $da );
477 $id = array_shift( $id );
478 $this->deleteTopic( $id );
481 # FIXME: Wikitext this
482 $r = "<p>" . htmlspecialchars( wfMsg( 'val_warning' ) ) . "</p>\n";
484 $r .= "<form method='post'>\n";
485 $r .= "<table border='1' cellspacing='0' cellpadding='2'>\n";
486 $r .= "<tr>" . wfMsg( 'val_list_header' ) . "</tr>\n";
487 foreach( $this->topicList
as $x => $y ) {
489 $r .= "<th>" . htmlspecialchars( $y->val_type
) . "</th>\n";
490 $r .= "<td>" . $this->linkTopic ( $y->val_comment
) . "</td>\n";
491 $r .= "<td>1 .. <b>" . intval( $y->val_value
) . "</b></td>\n";
492 $r .= "<td><input type='submit' name='m_del[" . intval( $x ) . "]' value='" . htmlspecialchars( wfMsg( 'val_del' ) ) . "'/></td>\n";
497 $r .= "<td><input type='text' name='m_topic' value=''/></td>\n";
498 $r .= "<td><input type='text' name='m_limit' value=''/></td>\n";
499 $r .= "<td><input type='submit' name='m_add' value='" . htmlspecialchars( wfMsg( 'val_add' ) ) . "'/></td>\n";
502 $r .= "<input type='checkbox' name='iamsure' value='1'/>" . htmlspecialchars( wfMsg( 'val_iamsure' ) ) . "\n";
507 # Generates a user ID for both logged-in users and anons; $x is an object from an SQL query
508 function make_user_id( &$x ) {
509 if( $x->val_user
== 0 ) {
516 function showDetails( &$article, $revision ) {
517 global $wgDBprefix, $wgOut, $wgUser;
518 $this->prepareRevisions( $article->getID() );
519 $this->topicList
= $this->getTopicList();
521 $title = $article->getTitle();
522 $wgOut->setPageTitle( str_replace( '$1', $title->getPrefixedText(), wfMsg( 'val_validation_of' ) ) );
524 # Collecting statistic data
525 $id = $article->getID();
526 $sql = "SELECT * FROM {$wgDBprefix}validate WHERE val_page='{$id}' AND val_revision='{$revision}'";
527 $res = wfQuery( $sql, DB_READ
);
531 while( $x = wfFetchObject( $res ) ) {
532 $data[$this->make_user_id($x)][$x->val_type
] = $x;
533 $users[$this->make_user_id($x)] = true;
534 $topics[$x->val_type
] = true;
537 # Sorting lists of topics and users
541 $ts = $this->getTimestamp( $revision );
542 $url = $this->getVersionLink( $article, $revision, wfTimestamp( TS_DB
, $ts ) );
546 $ret .= "<p><b>" . str_replace( '$1', $url, wfMsg( 'val_revision_of' ) ) . "</b></p>\n";
547 $ret .= "<table border='1' cellspacing='0' cellpadding='2'>\n";
550 foreach( $topics as $t => $dummy ) {
551 $ret .= "<th>" . $this->linkTopic ( $this->topicList
[$t]->val_comment
) . "</th>";
556 foreach( $users as $u => $dummy ) { # Every row a user
558 $ret .= "<th align='left'>";
559 if( !User
::IsIP( $u ) ) { # Logged-in user rating
560 $ret .= $this->link2userratings( $u, User
::whoIs( $u ) );
561 } else { # Anon rating
562 $ret .= $this->link2userratings( $u, $u );
565 foreach( $topics as $t => $dummy ) { # Every column a topic
566 if( !isset( $data[$u][$t] ) ) {
569 $ret .= "<td valign='center'>";
570 $ret .= $data[$u][$t]->val_value
;
571 if( $data[$u][$t]->val_comment
!= "" ) {
572 $ret .= " <small>(" . htmlspecialchars( $data[$u][$t]->val_comment
) . ")</small>";
580 $ret .= "<p>" . $this->link2statistics( $article ) . "</p>";
581 $ret .= "<p>" . $this->link2userratings( $wgUser->GetID(), wfMsg( 'val_show_my_ratings' ) ) . "</p>";
586 function showList( &$article ) {
587 global $wgDBprefix, $wgOut, $wgUser;
588 $this->prepareRevisions( $article->getID() );
589 $this->topicList
= $this->getTopicList();
591 $title = $article->getTitle();
592 $wgOut->setPageTitle( str_replace( '$1', $title->getPrefixedText(), wfMsg( 'val_validation_of' ) ) );
594 # Collecting statistic data
595 $id = $article->getID();
596 $sql = "SELECT * FROM {$wgDBprefix}validate WHERE val_page='{$id}'";
597 $res = wfQuery( $sql, DB_READ
);
599 while( $x = wfFetchObject( $res ) ) {
600 $idx = $this->getTimestamp( $x->val_revision
);
601 if( !isset( $data[$idx] ) ) {
602 $data[$idx] = array();
604 if( !isset( $data[$idx][$x->val_type
] ) ) {
605 $data[$idx][$x->val_type
]->count
= 0;
606 $data[$idx][$x->val_type
]->sum
= 0;
608 $data[$idx][$x->val_type
]->count++
;
609 $data[$idx][$x->val_type
]->sum +
= $x->val_value
;
615 $ret .= "<table border='1' cellspacing='0' cellpadding='2'>\n";
616 $ret .= "<tr><th>" . htmlspecialchars( wfMsg( "val_revision" ) ) . "</th>";
617 foreach( $this->topicList
as $x => $y ) {
618 $ret .= "<th>" . $this->linkTopic ( $y->val_comment
) . "</th>";
621 foreach( $data as $ts => $y ) {
622 $revision = $this->getRevisionNumber( $ts );
623 $url = $this->getVersionLink( $article, $revision, wfTimestamp( TS_DB
, $ts ) );
624 $detailsurl = $this->link2revisionstatistics( $article, $revision );
625 $ret .= "<tr><td>{$url} {$detailsurl}</td>";
626 foreach( $this->topicList
as $topicID => $dummy ) {
627 if( isset( $y[$topicID] ) ) {
629 if( $z->count
== 0 ) {
632 $a = $z->sum
/ $z->count
;
634 $ret .= sprintf( "<td><b>%1.1f</b> (%d)</td>", $a, $z->count
);
641 $ret .= "</table>\n";
642 $ret .= "<p>" . $this->link2userratings( $wgUser->getID(), wfMsg( 'val_show_my_ratings' ) ) . "</p>";
646 function getRatingText( $value, $max ) {
647 if( $max == 2 && $value == 1 ) {
648 $ret = wfMsg ( "val_no" ) . " ";
649 } elseif( $max == 2 && $value == 2 ) {
650 $ret = wfMsg( "val_yes" );
651 } elseif( $value != 0 ) {
652 $ret = wfMsg( "val_of", $value, $max ) . " ";
659 function showUserStats( $user ) {
660 global $wgDBprefix, $wgOut, $wgUser;
661 $this->topicList
= $this->getTopicList();
662 $data = $this->getAllVoteLists( $user );
664 if( $user == $wgUser->getID() ) {
665 $wgOut->setPageTitle ( wfMsg ( 'val_my_stats_title' ) );
666 } elseif( !User
::IsIP( $user ) ) {
667 $wgOut->setPageTitle( wfMsg( 'val_user_stats_title', User
::whoIs( $user ) ) );
669 $wgOut->setPageTitle( wfMsg( 'val_user_stats_title', $user ) );
672 $ret = "<table border='1' cellspacing='0' cellpadding='2'>\n";
674 foreach( $data as $articleid => $revisions ) {
675 $title = Title
::newFromID( $articleid );
676 $ret .= "<tr><th align='left' colspan='4'><a href=\"" . $title->escapeLocalURL() . "\">" . $title->getEscapedText() . "</a></th></tr>";
677 krsort( $revisions );
678 foreach( $revisions as $revid => $revision ) {
679 $url = $title->getLocalURL( "oldid={$revid}" );
680 $ret .= "<tr><th align='left'><a href=\"{$url}\">" . wfMsg( 'val_revision_number', $revid ) . "</a></th>";
683 foreach( $revision as $topic => $rating ) {
688 $ret .= "<td>" . $this->linkTopic ( $this->topicList
[$topic]->val_comment
) . "</td>";
689 $ret .= "<td>" . $this->getRatingText( $rating->val_value
, $this->topicList
[$topic]->val_value
) . "</td>";
690 $ret .= "<td>" . htmlspecialchars( $rating->val_comment
) . "</td>";
706 function wfSpecialValidate( $page = '' ) {
707 global $wgOut, $wgRequest, $wgUseValidation, $wgUser, $wgContLang;
709 if( !$wgUseValidation ) {
710 $wgOut->errorpage( "nosuchspecialpage", "nospecialpagetext" );
716 if( ! $wgUser->isAllowed('change_validation') ) {
717 $wgOut->sysopRequired();
722 $mode = $wgRequest->getVal( "mode" );
723 $skin = $wgUser->getSkin();
726 if( $mode == "manage" ) {
727 $v = new Validation();
728 $html = $v->manageTopics();
729 } elseif( $mode == "userstats" ) {
730 $v = new Validation();
731 $user = $wgRequest->getVal( "user" );
732 $html = $v->showUserStats( $user );
737 $t = Title
::newFromText( "Special:Validate" );
738 $url = $t->escapeLocalURL( "mode=manage" );
739 $html .= "<li><a href=\"" . $url . "\">Manage</a></li>\n";
744 $wgOut->addHTML( $html );